<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>qmr</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function  </center>
    <div align="right">Last update : 14/09/2005</div>
    <p>
      <b>qmr</b> -  quasi minimal resiqual method with preconditioning  </p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>[x,flag,err,iter,res] = qmr(A,b,x0,M1,M1p,M2,M2p,maxi,tol)  </tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>A  </b>
        </tt>
	  : matrix of size n-by-n or function returning <tt>
          <b>A*x</b>
        </tt>
      </li>
      <li>
        <tt>
          <b>b  </b>
        </tt>
	  : right hand side vector
	</li>
      <li>
        <tt>
          <b>x0  </b>
        </tt>
	  : initial guess vector (default: zeros(n,1))
	</li>
      <li>
        <tt>
          <b>M1  </b>
        </tt>
	  : left preconditioner: matrix or function returning <tt>
          <b>M1*x</b>
        </tt> (In the first case, default: eye(n,n))
	</li>
      <li>
        <tt>
          <b>M1p  </b>
        </tt>
	  : must only be provided when <tt>
          <b>M1</b>
        </tt> is a function. In this case <tt>
          <b>M1p</b>
        </tt> is the function which returns <tt>
          <b>M1'*x</b>
        </tt>
      </li>
      <li>
        <tt>
          <b>M2  </b>
        </tt>
	  : right preconditioner: matrix or function returning <tt>
          <b>M2*x</b>
        </tt> (In the first case, default: eye(n,n))
	</li>
      <li>
        <tt>
          <b>M2p  </b>
        </tt>
	  :  must only be provided when <tt>
          <b>M2</b>
        </tt> is a function. In this case <tt>
          <b>M2p</b>
        </tt> is the function which returns <tt>
          <b>M2'*x</b>
        </tt>
      </li>
      <li>
        <tt>
          <b>maxi  </b>
        </tt>
	  : maximum number of iterations (default: n)
	</li>
      <li>
        <tt>
          <b>tol  </b>
        </tt>
	  : error tolerance (default: 1000*%eps)
	</li>
      <li>
        <tt>
          <b>x  </b>
        </tt>
	  : solution vector
	</li>
      <li>
        <tt>
          <b>flag  </b>
        </tt>
	  : 0 = <tt>
          <b>qmr</b>
        </tt> converged to the desired tolerance within <tt>
          <b>maxi</b>
        </tt> iterations
	</li>
      <li>
        <tt>
          <b>res  </b>
        </tt>
	  : residual vector
	</li>
      <li>
        <tt>
          <b>err  </b>
        </tt>
	  : final residual norm
	</li>
      <li>
        <tt>
          <b>iter  </b>
        </tt>
	  : number of iterations performed
	</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>
      Solves the linear system <tt>
        <b>Ax=b</b>
      </tt> using the Quasi Minimal Residual Method with preconditioning.
    </p>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="gmres.htm">
        <tt>
          <b>gmres</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
    <h3>
      <font color="blue">Author</font>
    </h3>
    <p>
    SAGE Group, IRISA 2005
  </p>
  </body>
</html>
